<?php
/**
 * Created by litong on Date: 2019/2/25 0025 下午 1:56
 */
$firstname=$_REQUEST['firstname'];
$lastname=$_REQUEST['lastname'];
$phone=$_REQUEST['phone'];
$email=$_REQUEST['email'];
$sql = "insert into users(firstname,lastname,phone,email) values('$firstname','$lastname','$phone','$email')";
include 'conn.php';
$connection = getConnection();
$mysqli_result = mysqli_query($connection, $sql);
if($mysqli_result){
  echo json_encode(array('success'=>true));
}else{
  echo json_encode(array('msg'=>$mysqli_result));
}